#region <!--##session DefaultWholeClass##-->
	
		/*<!--##
		codeGeneratorVariable_DisplayCode.Append(GeneralUsing() + Environment.NewLine);
		##-->*/
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using EXtremecode.PresentationLayer;
namespace <!--##=RepositoryManager.Instance.Repository.ProjectName##-->
{
		/*<!--##
		 codeGeneratorVariable_DisplayCode.Append(DefaultCodeBehind() + Environment.NewLine);
		##-->*/
}
	
<!--##/session##-->
#endregion

#region <!--##session DefaultCodeBehind##-->
	public partial class Default : System.Web.UI.Page
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			if (UserProfile.Instance.User == null)
            {
                Response.Redirect(FormsAuthentication.LoginUrl, true);
            }
            else
            {
			   if (UserProfile.Instance.User.DefaultRole != null)
			   {
				   SiteMapNode node = siteMapDataSource.Provider.FindSiteMapNodeFromKey(UserProfile.Instance.User.DefaultRole.HomeModule);
				   string url = (node != null) ? node.Url : string.Empty;
				   if (!string.IsNullOrEmpty(url))
				   {
					   Response.Redirect(url);
				   }
				   else
				   {
					   /** Custom Region Start [Default Place1] **/
                       throw new Exception("Please define default page which have to be displayed after logged in");
                       /** Custom Region End **/
				   }
			   }
			   else
			   {
				   if (UserProfile.Instance.User.DefaultRole != null)
				   {
					   Response.Redirect(UserProfile.Instance.User.DefaultRole.HomeModule);
				   }
				   else
				   {
					   /** Custom Region Start [Default Place2] **/
                       throw new Exception("Please define default page which have to be displayed after logged in");
					   /** Custom Region End **/
                       
				   }
			   }
			}
		}
	}
<!--##/session##-->
#endregion



